<template>
  <div class="login-container">
    <el-form class="login-form" ref="form" :model="user">
      <div class="title">后台管理系统</div>
      <el-form-item>
        <el-input 
          v-model="user.mobile"
          placeholder="请输入用户名"
        ></el-input>
      </el-form-item>

      <el-form-item>
        <el-input 
          v-model="user.code"
          placeholder="请输入密码"
        ></el-input>
      </el-form-item>
      <el-form-item>
       <el-checkbox v-model="checked">我已阅读并同意用户协议和隐私条款</el-checkbox>
      </el-form-item>
      <el-form-item>
        <el-button 
          class="login-btn" 
          type="primary" 
          @click="onLogin"
        >
          登录
        </el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'LoginIndex',
  components: {},
  props: {},
  data() {
    return {
      user: {
          mobile: '13911111111',
          code: '246810',
      },
      checked: false

    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  methods: {
    async onLogin() {
      const user = this.user
      const { data } = await this.$http.login(user)
      console.log(data);
    }
  }
}
</script>

<style scoped lang="less">
  .login-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url("./login_bg.jpg") no-repeat;
    background-size: cover;
    .login-form {
      padding: 50px;
      min-width: 300px;
      background-color: #ffffff;
      .title {
        margin-bottom: 20px;
        text-align: center;
        color: #66b1ff;
        font-weight: 700;
      }
      .login-btn {
        width: 100%;
      }
    }
  }
</style>
